#pragma once
#include <string>
#include <map>
#include "../shared/shared_types.h"

namespace Putin{

typedef std::map<std::string,unsigned int> AudioMap;

/**
 * A program state base class 
 * that is used to specify more detailed parts of the game engine
 * such as main game or the lobby or the menu
 * Fungerar detta mutanton?
 */
class ProgramState
{
public:
        ProgramState(void){}
        virtual ~ProgramState(void){}

        /**
         * Initialize subsystems
         */
        virtual bool initialize() = 0;

        virtual void terminate() = 0;
        
        /**
         * Frame update
         */
        virtual bool update() = 0;
        
        /**
         * Perform render routines
         */ 
        virtual bool render() = 0;
        
        /**
         * Load resources such as sounds and textures
         */
        virtual bool loadResources() = 0;

        /**
         * Fires when mouse is clicked
         */
        virtual void mouseDown(int x, int y, int mb){}

        virtual bool setMusic(std::string filename);
        virtual bool playMusic();
        virtual void stopMusic();
        virtual bool loadSound(std::string filename);
        virtual void unloadAudios();
        virtual unsigned int getSoundBuffer(std::string filename);
        virtual void playSound(std::string id, Vec3f& pos, Vec3f& vel, const char* cullType);
        
        /**
         * Fires when the mouse is released
         */
        virtual void mouseUp(int x, int y, int mb){}
        virtual void mouseMove(int x, int y){}
        virtual void keyDown(char key){}
        virtual void keyUp(char key){}
        virtual void keyPress(char c){}

protected:

        AudioMap        mAudio;
};



}